package edu.sctu.practice.class01.xiangkun.assign03.demotwo;

/**
 * Created by xiangkun on 2015/11/5.
 */
public class TestInterface {

    public static void main(String[] args) {

        ComparableCircle circle1 = new ComparableCircle(5);
        ComparableCircle circle2 = new ComparableCircle(4);
        Comparable circle = Max.max(circle1, circle2);
        System.out.println("最大的圆的半径是" + ((Circle) circle).getRadius());
        System.out.println(circle);

        ComparableCylinder cylinder1 = new ComparableCylinder(5, 2);
        ComparableCylinder cylinder2 = new ComparableCylinder(4, 5);
        Comparable cylinder = Max.max(cylinder1, cylinder2);
        System.out.println();
        System.out.println("圆柱1的体积是" + cylinder1.findVolume());
        System.out.println("圆柱2的体积是" + cylinder2.findVolume());
        System.out.println("最大的圆柱的\n半径是 " + ((Cylinder) cylinder).getRadius() + "\n长是： " + ((Cylinder) cylinder).getLength() + "\n体积是： " + ((Cylinder) cylinder).findVolume());
        System.out.println(cylinder);

    }

}


